﻿#ifndef LINEEDIT_TURNTABLERATE
#define LINEEDIT_TURNTABLERATE

#include <qlineedit.h>

class LineEdit_TurnTableRate : public QLineEdit
{
  Q_OBJECT
public:
  enum Mode
  {
    PositionMode,
    RateMode
  };
private:
  Mode mode = PositionMode;

  float turnTableRateUpperLimit = 5000;//转台速率上限（绝对值）
  float turnTableRateLowerLimit = 1;//转台速率下限（绝对值）

  int accuracy = 4;
public:
  LineEdit_TurnTableRate(QWidget *parent);
  ~LineEdit_TurnTableRate();
  float getRate();
  void setRate(float rate);
  void turnMode(Mode mode);
private slots:
  void slot_rateLineEditFinished();
  void slot_updatePlaceHolder();
public:
  Mode currentMode();
  float getTurnTableRateUpperLimit();
  void setTurnTableRateUpperLimit(float turnTableRateUpperLimit);
  float getTurnTableRateLowerLimit();
  void setTurnTableRateLowerLimit(float turnTableRateLowerLimit);
  int getAccuracy();
  void setAccuracy(int accuracy);
};
#endif
